﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net.Mail;

namespace LogicUniversityBiz
{
    public class EmailController
    {


        public void send(string toEmail,string fromEmail,string subject, string Body)
        {
            try 
            { 
                MailMessage mailMessage = new MailMessage(); 
                mailMessage.To.Add(toEmail);
                mailMessage.From = new MailAddress(fromEmail);
                //mailMessage.CC.Add("michael_liau@hotmail.com");
                mailMessage.Subject = subject;
                mailMessage.Body = Body;
                //SmtpClient smtpClient = new SmtpClient("mail.singnet.com.sg"); 
                SmtpClient smtpClient = new SmtpClient("lynx.iss.nus.edu.sg");
                smtpClient.Send(mailMessage); 
            }
            catch (Exception ex) {
                return;
            }
        }
    }
}
